import request from '@/utils/request'

// 新增服务分类
export function PostClazz(data) {
    return request({
        url: '/logic/clazz',
        method: 'post',
        data: data
    })
}
// 修改服务分类
export function PutClazz(query) {
    return request({
        url: '/logic/clazz',
        method: 'put',
        data: query
    })
}
// 导出服务分类列表
export function ClazzExport(query) {
    return request({
        url: '/logic/clazz/export',
        method: 'get',
        params: query
    })
}
// 查询服务分类列表
export function ClazzList(query) {
    return request({
        url: '/logic/clazz/list',
        method: 'get',
        params: query
    })
}
// 查询服务分类列表
export function exclude(id) {
    return request({
        url: '/list/exclude/'+id,
        method: 'get',
    })
}

// 删除服务分类
export function DelectClazz(ids) {
    return request({
        url: '/logic/clazz/'+ ids,
        method: 'DELETE',
    })
}
// 获取服务分类详细信息
export function ClazzId(id) {
    return request({
        url: '/logic/clazz/'+id,
        method: 'get',
    })
}
// 查询服务分类树
export function treeselect(query) {
    return request({
        url: '/treeselect',
        method: 'get',
        params: query
    })
}



// 新增服务目录
export function PostCatalog(data) {
    return request({
        url: '/logic/catalog',
        method: 'post',
        data: data
    })
}
// 修改服务目录
export function PutCatalog(query) {
    return request({
        url: '/logic/catalog',
        method: 'put',
        data: query
    })
}
// 导出服务目录列表
export function CatalogExport(query) {
    return request({
        url: '/logic/catalog/export',
        method: 'get',
        params: query
    })
}
// 查询服务目录列表
export function CatalogList(query) {
    return request({
        url: '/logic/catalog/list',
        method: 'get',
        params: query
    })
}
// 删除服务目录
export function DelectCatalog(ids) {
    return request({
        url: '/logic/catalog/'+ids,
        method: 'DELETE',
    })
}
// 获取服务目录详细信息
export function CatalogId(id) {
    return request({
        url: '/logic/catalog/'+id,
        method: 'get',
    })
}




// 新增服务单价
export function PostPrice(data) {
    return request({
        url: '/logic/price',
        method: 'post',
        data: data
    })
}
// 修改服务单价
export function PutPrice(query) {
    return request({
        url: '/logic/price',
        method: 'put',
        data: query
    })
}
// 导出服务单价列表
export function PriceExport(query) {
    return request({
        url: '/logic/price/export',
        method: 'get',
        params: query
    })
}
// 查询服务单价列表
export function PriceList(id, cloudSupplier = '', pageNum,pageSize) {
    return request({
        url: '/logic/price/list?catalogId=' + id + '&cloudSupplier=' + cloudSupplier + '&pageNum=' + pageNum + '&pageSize=' + pageSize,
        method: 'get',
    })
}
// 删除服务单价
export function DelectPrice(ids) {
    return request({
        url: '/logic/price/' + ids,
        method: 'DELETE',
    })
}
// 获取服务单价详细信息
export function PriceIds(id) {
    return request({
        url: '/logic/price/' + id,
        method: 'get',
    })
}



// 新增云服务商
export function Postlogic(data) {
    return request({
        url: '/logic/cloudSupplier',
        method: 'post',
        data: data
    })
}
// 修改云服务商
export function Putlogic(query) {
    return request({
        url: '/logic/cloudSupplier',
        method: 'put',
        data: query
    })
}
// 导出云服务商列表
export function logicExport(query) {
    return request({
        url: '/logic/cloudSupplier/export',
        method: 'get',
        params: query
    })
}
// 查询云服务商列表
export function logicList(query) {
    return request({
        url: '/logic/cloudSupplier/list',
        method: 'get',
        params: query
    })
}

// 查询云服务商列表
export function supplierList(query) {
  return request({
    url: '/logic/cloudSupplier/list',
    method: 'get',
    params: query
  })
}

// 查询云服务商列表
export function statement(query) {
    return request({
        url: '/statement/list',
        method: 'get',
        params: query
    })
}
// 删除云服务商
export function Delectlogic(ids) {
    return request({
        url: '/logic/cloudSupplier/' + ids,
        method: 'DELETE',
    })
}
// 获取云服务商详细信息
export function logicIds(id) {
    return request({
        url: '/logic/cloudSupplier/' + id,
        method: 'get',
    })
}

// 保存规格
export function saveSpecGroup(data) {
  return request({
    url: '/save/spec/group',
    method: 'post',
    header:{
      'Content-Type':'application/json'  //如果写成contentType会报错
    },
    data: data
  })
}

// 系统导入模板
export function importHostTemplateCloudUp() {
  return request({
    url: '/importCloudUp/template',
    method: 'get'
  })
}
// 云主机导入模板
export function importHostTemplateEcs() {
  return request({
    url: '/importHost/template',
    method: 'get'
  })
}
// 其他资源导入模板
export function importHostTemplateOther() {
  return request({
    url: '/importOther/template',
    method: 'get'
  })
}

